{% extends "base_irc.html" %}
{% load cache %}
{% load timezone_filters %}
{% block title %}DjangoBot: {{ channel }} logs{% endblock %}
{% block heading %}DjangoBot: {{ channel }}{% endblock %}

{% block search_post_url %}{% url channel_search channel_name %}{% endblock %}
{% block content %}
    <h1>{{ channel }}</h1>

	{% load colorme %}
	
    <table>
        {% for message in messages %}
		{% ifchanged %}
	</table>
	<h3><a href="{{ channel.get_absolute_url }}{{ message.logged|localtime:user_timezone|date:"Y/m/d/"}}">{{ message.logged|date:"N jS, Y" }}</a></h3>
	<table>
		{% endifchanged %}
        <tr valign="top">
            <td><a href="#">{{ message.logged|localtime:user_timezone|date:"H:i" }}</a></td>
            {% if not message.is_blocked %}
            {% if message.is_action %}
            <td colspan="2">{{ message.nickname }} {{ message.text|urlizetrunc:"50" }}</td>
            {% else %}
            <td align="right" style="color: {{ message.nickname|colorize }};"><strong>{{ message.nickname }}</strong></td>
            <td><div style="overflow:auto;">{{ message.text|urlizetrunc:"50" }}</div></td>
            {% endif %}
            {% else %}
            <td align="right" style="color: {{ message.nickname|colorize }};"><strong>{{ message.nickname }}</strong></td>
            <td><div style="overflow:auto;">&lt; this message has been blocked. &gt;</div></td>
            {% endif %}
        </tr>
        {% endfor %}
    </table>
{% endblock %}

{% block sidebar %}
{% load cal %}
{% display_calendar for date in channel %}

<h2>Top Talkers</h2>
<ol>
    {% cache 43200 top_talkers channel %}
    {% for line in channel.top_talkers %}
    <li>{{ line.nickname }}</li>
    {% endfor %}
    {% endcache %}
</ol>
{% endblock %}